package com.xing.okhttp;

import com.xing.okhttp.all.DebugHttpClientManager;
import okhttp3.Response;
import org.junit.Test;

public class OkhttpMain {

    public static void main(String[] args) throws Exception{

        IHttpClientManager httpClientManager = new DebugHttpClientManager.Builder()
//                .usePrivateSSL(true)
//                .useSSL(true)
                .proxyHost("127.0.0.1")
                .proxyPort(8888)
//                .proxyUser("jesse")
//                .proxyPass("password1")
                .build();
        Response response = httpClientManager.syncGet("http", "fanyi.baidu.com", 80,
                "/translate?aldtype=16047&query=&keyfrom=baidu&smartresult=dict&lang=auto2zh#auto/zh/", "");
        System.err.println(response);
    }

    @Test
    public void testBaidu() throws Exception{
        IHttpClientManager httpClientManager = new DebugHttpClientManager.Builder()
                //.usePrivateSSL(true)
                //.useSSL(true)
                //.proxyHost("127.0.0.1")
                //.proxyPort(8888)
                .build();
        Response response = httpClientManager.syncGet("https", "www.baidu.com", 443,
                "", "");
        System.err.println(response);

    }
}
